package com.wangxl.springbootdemocore.utils;

import com.wangxl.springbootdemocore.vo.ResultVO;

/**
 * @ClassName:ResultVOUtil
 * @Description: ResultVOUtil工具类
 * @Author : Wangxl
 * @Email：475524154@qq.com
 * @Date:2018/12/7 000715:09
 * @Version:1.0
 **/

public class ResultVOUtil {

    public static ResultVO success() {
        return success(null);
    }

    public static ResultVO success(Object object) {
        ResultVO resultVO = new ResultVO();
        resultVO.setData(object);
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        return resultVO;
    }

    public static ResultVO error(Integer code, String msg) {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(code);
        resultVO.setMsg(msg);
        return resultVO;
    }
}
